/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author Cheng
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '/@/api/model/baseModel';

const { adminPath } = useGlobSetting();

export interface InMaintenanceInfo extends BasicModel<InMaintenanceInfo> {
  title?: string; // 任务标题
  maintenanceEnterpriseId?: string; // 维保企业ID
  maintenanceEnterpriseName?: string; // 维保企业名称
  userCode?: string; // 维保人员code
  userName?: string; // 维保人员姓名
  enterpriseId?: string; // 业主企业ID
  enterpriseName?: string; // 业主企业名称
  executeMonth?: string; // 执行年份时间
  state?: string; // 状态（0: 已下发, 1: 分配完成, 2: 维保中, 3: 维保完成）
  startExecuteTime?: string; // 执行开始时间
  completeTime?: string; // 任务完成时间
  createTime?: string; // 创建时间
  updateTime?: string; // 更新时间
  contractId?: number; // 维保合同ID
  taskStartDate?: string; // 维保任务开始年月
  taskEndDate?: string; // 维保任务结束年月
  dataPermissions?: string; // 数据权限标识，一般与业主单位一致
  deleted?: string; // 逻辑删除标识（FALSE: 未删除, TRUE: 已删除）
  tid?: string; // 任务ID
}

export const inMaintenanceInfoList = (params?: InMaintenanceInfo | any) =>
  defHttp.get<InMaintenanceInfo>({ url: adminPath + '/maintenance/management/inMaintenanceInfo/list', params });

export const inMaintenanceInfoListData = (params?: InMaintenanceInfo | any) =>
  defHttp.post<Page<InMaintenanceInfo>>({ url: adminPath + '/maintenance/management/inMaintenanceInfo/listData', params });

export const inMaintenanceInfoForm = (params?: InMaintenanceInfo | any) =>
  defHttp.get<InMaintenanceInfo>({ url: adminPath + '/maintenance/management/inMaintenanceInfo/form', params });

export const inMaintenanceInfoSave = (params?: any, data?: InMaintenanceInfo | any) =>
  defHttp.postJson<InMaintenanceInfo>({ url: adminPath + '/maintenance/management/inMaintenanceInfo/save', params, data });

export const inMaintenanceInfoDelete = (params?: InMaintenanceInfo | any) =>
  defHttp.get<InMaintenanceInfo>({ url: adminPath + '/maintenance/management/inMaintenanceInfo/delete', params });

export const inMaintenanceInfoUpdateUserCode = (params?: any, data?: InMaintenanceInfo | any) =>
  defHttp.postJson<InMaintenanceInfo>({ url: adminPath + '/maintenance/management/inMaintenanceInfo/updateUserCode', params, data });
